package net.bluemind.unixsocket.impl;

import com.sun.jna.Structure;

/**
 * A Unix domain socket address is represented in the following structure:
 * 
 * <code>
 * #define UNIX_PATH_MAX 108
 * 
 * struct sockaddr_un { 
 *   sa_family_t sun_family; 
 *   char sun_path[UNIX_PATH_MAX];
 * };
 * </code>
 * 
 * sun_family always contains AF_UNIX.
 * 
 * Look man unix(7) for more infos
 */
public class sockaddr_un extends Structure {
	public short sun_family;
	public byte[] sun_path;

	public sockaddr_un(short family, byte[] path) {
		sun_family = family;
		sun_path = path;
		allocateMemory();
	}
}
